﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using DrWPF.Windows.Data;
using System.Collections.ObjectModel;

namespace MartinCarolan.EventSpy.UI.Converters
{
    public class ListToCountConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var vals = value as Dictionary<object, ObservableCollection<EventRegistrationEntry>>.ValueCollection;
            return vals.Sum(e => e.Count);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
